package com.sias.realestate.web.service.impl;


import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.sias.realestate.core.generic.GenericDao;
import com.sias.realestate.core.generic.GenericServiceImpl;
import com.sias.realestate.web.dao.NotificationMapper;
import com.sias.realestate.web.model.Notification;
import com.sias.realestate.web.service.NotificationService;

@Service
public class NotificationServiceImpl extends GenericServiceImpl<Notification, Integer> implements NotificationService{

	@Resource
	private NotificationMapper notificationmapper;


	@Override
    public int insert(Notification model) {
        return notificationmapper.insertSelective(model);
    }

    @Override
    public int update(Notification model) {
        return notificationmapper.updateByPrimaryKeySelective(model);
    }

    @Override
    public int delete(Integer id) {
        return notificationmapper.deleteByPrimaryKey(id);
    }

    @Override
    public Notification selectById(Integer id) {
        return notificationmapper.selectByPrimaryKey(id);
    }
    
	@Override
	public List<Notification> selectList() {
		// TODO Auto-generated method stub		
		return notificationmapper.findAll();
	}
	@Override
	public GenericDao<Notification, Integer> getDao() {
		// TODO Auto-generated method stub
		return notificationmapper;
	}

	@Override
	public List<Notification> findNotificationByOid(String oid) {
		// TODO Auto-generated method stub
		return notificationmapper.selectByOid(oid);
	}

	@Override
	public List<Notification> findNotificationByOidIfType(String oid, Integer ntype) {
		// TODO Auto-generated method stub
		return notificationmapper.selectByOidIfType(oid, ntype);
	}


}
